<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Books Infomation</title>
<style type="text/css">
<!--
.STYLE1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 36px;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<body>
<?php

    include "./config.php";	
	$username=$_GET['username']; 
	$endtimeindex = 0;
	$booktime;
    if(!$_SESSION['loginstat'])
    {
        echo "<table width = 600 border = 1 align = center>";
        echo "<tr>";
        echo "<td colspan = 6><div align = center class = STYLE1>Books Information </div></td>";
        echo "</tr>";
        echo  "<tr>";
        echo "<td>Book ID </td>";
        echo "<td>BookName</td>";
        echo "<td>Book description</td>";
        echo "<td>Book Price </td>";
        echo "<td>Book amount</td>";
        echo "<td>Time Remaining</td>";
        echo "</tr>";
        $result = mysql_db_query($main_db,"select * from books", $conn);
        while($row=mysql_fetch_row($result))
         {
		 	  $booktime = date(i) +  $row[5];
              echo "<tr>";
              for ($i=0; $i<mysql_num_fields($result); $i++)
             {
                 echo "<td>$row[$i]</td>";
             }
             echo "</tr>";
         }
        echo "</table>";
    }
    else
    {
        echo "please login";
    }

echo "<form id=form1 name=form1 method=post action=./cheakbid.php?username=$username&booktime=$booktime>";
echo "  <table width=290 border=1 align=center>";
echo "    <tr>";
echo "      <td colspan=2><div align=center>BID</div></td>";
echo "    </tr>";
echo "    <tr>";
echo "      <td width=99>BookID:</td>";
echo "      <td width=175><label>";
echo "        <input name=bookid type=text id=bookid />";
echo "      </label></td>";
echo "    </tr>";
echo "    <tr>";
echo "      <td>Price: </td>";
echo "      <td><label>";
echo "        <input name=bookprice type=text id=bookprice />";
echo "      </label></td>";
echo "    </tr>";
echo "    <tr>";
echo "      <td>Amount:</td>";
echo "      <td><label>";
echo "        <input name=bookamount type=text id=bookamount />";
echo "      </label></td>";
echo "		</tr>";
echo "    <tr>";
echo "      <td colspan=2><label>";
echo "        <div align=center>";
echo "          <input type=submit name=Submit value=bid />";
echo "    <input name=Submit2 type=button onClick=MM_goToURL('parent','./showmy.php?username=$username');return document.MM_returnValue value=MyInformation>";
echo "        </div>";
echo "      </label></td>";
echo "    </tr>";
echo "  </table>";
echo "</form>";
?>
<label>
</label>
<a href="./sell.html">sell
</a>
</body>
</html>

